﻿
using System.ComponentModel;
using System.Runtime.CompilerServices;
using GDI.Annotations;

namespace GDI.Plotters
{
    public class SimplePoint : INotifyPropertyChanged
    {
        /* ------------------------------------------------------------------------------------------ */

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string PropertyName = null)
        {
            var lv_Handler = PropertyChanged;
            if(lv_Handler != null)
                lv_Handler(this, new PropertyChangedEventArgs(PropertyName));
        }

        /* ------------------------------------------------------------------------------------------ */

        private double f_X;
        private double f_Y;

        /* ------------------------------------------------------------------------------------------ */

        public double X
        {
            get { return f_X; }
            set
            {
                f_X = value;
                OnPropertyChanged();
            }
        }

        public double Y
        {
            get { return f_Y; }
            set
            {
                f_Y = value;
                OnPropertyChanged();
            }
        }

        /* ------------------------------------------------------------------------------------------ */

        public SimplePoint(double X, double Y) { f_X = X; f_Y = Y; }

        /* ------------------------------------------------------------------------------------------ */

        /* ------------------------------------------------------------------------------------------ */
    }
}
